<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class CategoriesController extends Controller
{
    //
    public function __construct(){

        $this->middleware(['auth.admin']);

    }

    public function index()
    {
        $cates = repository()->categories->allFormatCategories();

        //dd($cates);
        $cates = collect($cates)->map(function ($item) {
            return (object)$item;
        });

        return  view('admin.categories.index', compact('cates'));
    }


}
